import React, { useState,useEffect } from 'react'
import {fromJS} from 'immutable'

const immutableObj =fromJS({
        a:{
            b:1
        }
    })
console.log(immutableObj.get('a').set('b',2));
    
export default function Dong3() {
    const [state, setState] = useState(fromJS({
        a:{
            b:1
        }
    }))
    useEffect(()=>{
        setTimeout(()=>{
            state.a.b =2
            setState(state)
        },2000)
    },[])
  return (
    <div>我是Dong3组件,{state.a.b}</div>
  )
}
